package view;
import javax.swing.*;

import controller.Cancel;
import controller.Restore;
import controller.Validate;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


/**
 * 
 */

/**
 * @author Leo COLLET, Nelle VAROQUAUX
 *
 */
public class FenetrePrincipale extends JFrame implements ActionListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public FenetrePrincipale(){
		super();
		this.build();
	}

	private void build() {
		this.setTitle("GaGa Dressing Room");
		this.setSize(1024, 768);
		this.setLocationRelativeTo(null);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setContentPane(this.buildContentPane());
	}

	private JPanel buildContentPane() {
		JPanel panel = new JPanel();
		panel.setLayout(null);
		
		/**
		 * Titre
		 */
		JLabel label_welcome = new JLabel("Bienvenue dans votre Dressing Room");
		label_welcome.setVisible(true);
		label_welcome.setBounds(130, 10, 814, 50);
		label_welcome.setHorizontalAlignment(SwingConstants.CENTER);
		panel.add(label_welcome);
		
		/**
		 * Annuler
		 */
		JButton button_cancel = new JButton(new Cancel());
		button_cancel.addActionListener(this);
		button_cancel.setBounds(10, 10, 50, 50);
		panel.add(button_cancel);
		
		/**
		 * Retablir
		 */
		JButton button_restore = new JButton(new Restore());
		button_restore.addActionListener(this);
		button_restore.setBounds(70, 10, 50, 50);
		panel.add(button_restore);
		
		/**
		 * Valider
		 */
		JButton button_validate = new JButton(new Validate());
		button_validate.addActionListener(this);
		button_validate.setBounds(934, 10, 70, 50);
		panel.add(button_validate);
		
		/**
		 * Laundry Basket
		 */
		LaundryBasket laundry = new LaundryBasket();
		/*JButton button_laundryBasket = new JButton(new LaundryBasket());
		button_laundryBasket.addActionListener(this);
		button_laundryBasket.setBounds(854, 10, 70, 50);*/
		panel.add(laundry);

		/**
		 * Wardrobe
		 */

		Wardrobe wardrobe = new Wardrobe();
		/*JButton button_wardrobe = new JButton(new Wardrobe());
		button_wardrobe.addActionListener(this);
		button_wardrobe.setBounds(774, 10, 70, 50);*/
		panel.add(wardrobe);
		

		/**
		 * Liste d'habits
		 */
		ListeHabits listehabits = new ListeHabits();
		panel.add(listehabits);
		
		/**
		 * Visualisation d'un habit
		 */
		VisuHabit visuhabit = new VisuHabit();
		panel.add(visuhabit);
		
		/**
		 * Visualisation 3D de la tenue complete
		 */
		Visu3D visu3d = new Visu3D();
		panel.add(visu3d);
		
		return panel;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}
